<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <%@ include file="/common/ssb/include/common-base.jsp"%>
  <title>账户管理</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
</head>

<!-- Part 一、 以下是body主体内容的模块区域 -->
<body class="hold-transition ${sysColor} sidebar-mini">
<div class="wrapper">

  <!-- top start -->
  <%@include file="/common/ssb/top.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/ssb/left.jsp" %>
  <!-- left end-->

	<div class="content-wrapper">
		<!-- Main start -->
		<section class="content">
			<div id="div_hidden_content" class="hidden" style="display:none;">
				<div id="hidden_common_final">
					<!-- temp="hidden_common_final" start -->
					<input name="mainObjName" type="hidden" value="uctUser">
					<input name="mainObjPrimaryKey" type="hidden" value="userId">
					<input name="objNameAll" type="hidden" value="uctUser">
					<!-- temp="hidden_common_final" end -->
				</div>
				<!-- temp="delForm_hidden" start -->
				<div id="delForm_hidden">
					<input name="pageName" type="hidden" value="user-list"/>
					<input name="formName" type="hidden" value="delForm"/>
				</div>
				<!-- temp="delForm_hidden" end -->
			</div>
			<div class="row">
				<div class="col-xs-12">

					<!------搜索  start ------->
					<div class="box box-info">
						<!--搜索title  start -->
						<div class="box-header with-border">
							<h3 class="box-title"><i class="fa fa-search"></i> 系统账户搜索</h3>
							<div class="box-tools pull-right">
								<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
							</div>
						</div>
						<!--搜索title  end -->
						<div class="box-body">
							<form id="searchForm" action="javascript:;">
								<!-- temp="searchForm_hidden" start -->
								<div id="searchForm_hidden">
									<input type="hidden" name="pageName" value="user-list"/>
									<input type="hidden" name="formName" value="searchForm-new"/>
									<input type="hidden" name="uctUser.w_userType" value="manager"/>
									<input type="hidden" name="uctUser.w_sysEname" value="ssb"/>
									<input type="hidden" name="uctUser.wn_userEname" value="ssb_admin"/>
									<input type="hidden" name="orderBy" value="uctUser.create_time desc"/>
								</div>
								<!-- temp="searchForm_hidden" end -->
								<!-- temp="searchForm_content" start -->
								<div id="searchForm_content" class="form-group"  data-temp-code="true" data-temp-type="searchForm" data-temp-form-id="searchForm">

									<table class="table table-bordered bordercolor">
										<tbody>
										<tr>
											<td class="active" align="right"><label class="form-control-static">登录账号：</label></td>
											<td>
												<div class="form-group"><input name="uctUser.wl_userEname" class="form-control clean"
																			   maxlength="30" data-temp-obj="uctUser.userEname"></div>
											</td>
											<td class="active" align="right"><label class="form-control-static">用户名称：</label></td>
											<td>
												<div class="form-group"><input name="uctUser.wl_userCname" class="form-control clean"
																			   maxlength="30" data-temp-obj="uctUser.userCname"></div>
											</td>
										</tr>
										</tbody>
									</table>
								</div>
								<!-- temp="searchForm_content" end -->
							</form>
							<div class="box-footer text-center">
								<button type="button" class="btn btn-success" onclick="getTableData();" data-temp-event="searchForm_hidden"><i class="fa fa-search"></i> 查询</button> 
								<button type="button" class="btn btn-warning" onclick="mytools.cleanData('#searchForm');">重置 </button>
							</div>
						</div>
					</div>
					<!------- 搜索 end -------->

					<!------- 列表 start -------->
					<div class="box box-success">
						<!--列表title  start -->
						<div class="box-header with-border">
							<h3 class="box-title"><i class="fa fa-table"></i> 查询结果
                            <c:if test="${loginUser.userType=='manager'}">
								　<button id="button_to_add" onclick="toAdd();" class="btn btn-success" type="button"><i class="fa fa-plus-circle"></i> 增加系统账户 </button>
                            </c:if>
							</h3>
							<div class="box-tools pull-right">
								<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
							</div>
						</div>
						<div class="box-body">
							<table id="dataList" class="table table-bordered table-hover">
								<thead>
								<tr id="dataList_thead_content" data-temp-code="true" data-temp-type="table" data-temp-show="dataList_template_content">
									<th>序号</th>
									<!-- temp="dataList_thead_content" start -->

									<th data-temp-obj="uctUser.userEname">登录账号</th>
									<th data-temp-obj="uctUser.userCname">用户名称</th>
									<th data-temp-obj="uctUser.mobile">手机</th>
									<th data-temp-obj="uctUser.createTime">创建时间</th>
									<th data-temp-obj="uctUser.userStatus">账号状态</th>
									<th>操作</th>
									<!-- temp="dataList_thead_content" end -->
								</tr>
								</thead>
								<tbody id="dataList-body">

								</tbody>
							</table>
						</div>

						<div class="box-footer text-center">
							<ul id="dataList-page" class="pagination">
							</ul>
						</div>
					</div>
					<!------- 列表 end -------->
				</div>
			</div>

			<div win-title="添加窗口" class="modal fade" id="my_modal_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog" style="width:80%;">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								×
							</button>
							<h4 class="modal-title">
								<font color="red">系统账户添加</font> 
							</h4>
						</div>

						<div class="modal-body">

							<div class="nav-tabs-custom">
								<ul class="nav nav-tabs" id="myTab-add">
								</ul>

								<!-- tab content start -->
								<div class="tab-content">

									<div class="tab-pane active" id="tabAdd_1">
										<form class="form-horizontal addFormBody" role="form" id="addForm1" action="javascript:void(0)">
											<input type="hidden" class="formToken" id="addForm1_formToken" name="formToken" />
											<input type="hidden" name="uctUser.userPass" />
											<input type="hidden" name="uctUser.orgId" value="${loginUser.orgId}"/>
											<input type="hidden" name="uctUser.orgEname" value="${loginUser.orgEname}"/>
											<input type="hidden" name="uctUser.deptId" value="${loginUser.deptId}"/>
											<input type="hidden" name="uctUser.deptName" value="${loginUser.user.deptName}"/><!--部门名称-->
											<input type="hidden" name="uctUser.sysEname" value="ssb"/>
											<input type="hidden" name="uctUser.userStatus" value="1"/><!--用户状态 1启用,0停用,-1删除-->
											<input type="hidden" name="uctUser.delStatus" value="3"/><!--3机构内系统管理员-->
											<input type="hidden" name="uctUser.userType" value="manager"/><!--用户类型manager(管理员)-->
											<input type="hidden" name="uctUser.regSource" value="plate"/><!--注册来源    web：来自互联网注册  plate：后台开户-->
											<input type="hidden" name="uctUser.auditStatus" value="91"/><!-- 审核状态待审核：10待审核 ；91审核通过；90审核不通过-->

											<!-- temp="addForm1_hidden" start -->
											<div id="addForm1_hidden" style="display:none;">
												<input type="hidden" name="pageName" value="user-list"/>
												<input type="hidden" name="formName" value="addForm"/>
											</div>
											<!-- temp="addForm1_hidden" end -->

											<!-- temp="addForm1_content" start -->
											<div id="addForm1_content" data-temp-code="true" data-temp-type="addForm" data-temp-form-id="addForm1">


												<table class="table table-bordered bordercolor">
													<tbody>
													<tr>
														<td class="active" align="right"><label
																class="form-control-static">登录账号：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.userEname"
																						   class="form-control clean"
																						   maxlength="30"
																						   data-temp-obj="uctUser.userEname"
																						   placeholder="请输入登录账号"
																						   data-bv-notempty="true"
																						   data-bv-notempty-message="登录账号不能为空" data-bv-regexp="true" data-bv-regexp-regexp="^[a-z0-9_]+$" data-bv-regexp-message="必须是小写英文、数字或下划组成">
															</div>
														</td>
														<td class="active" align="right"><label
																class="form-control-static">用户名称：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.userCname"
																						   class="form-control clean"
																						   maxlength="30"
																						   data-temp-obj="uctUser.userCname"
																						   placeholder="请输入用户名称"
																						   data-bv-notempty="true"
																						   data-bv-notempty-message="用户名称不能为空">
															</div>
														</td>
													</tr>
													<tr>
														<td class="active" align="right"><label
																class="form-control-static">登录密码：</label></td>
														<td>
															<div class="form-group"><input name="userPass1"
																						   class="form-control clean"
																						   maxlength="30"
																						   data-temp-obj="uctUser.userPass"
																						   data-type-tag="password"
																						   placeholder="请输入登录密码"
																						   data-bv-notempty="true"
																						   data-bv-notempty-message="登录密码不能为空"
																						   type="password"></div>
														</td>
														<td class="active" align="right"><label
																class="form-control-static">确认密码：</label></td>
														<td>
															<div class="form-group"><input name="userPass2"
																						   class="form-control clean"
																						   maxlength="30"
																						   data-temp-obj="uctUser.userPass2"
																						   data-type-tag="password"
																						   placeholder="请输入确认密码"
																						   data-bv-notempty="true"
																						   data-bv-notempty-message="确认密码不能为空"
																						   type="password"></div>
														</td>
													</tr>
													<tr>
														<td class="active" align="right"><label
																class="form-control-static">手机：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.mobile"
																						   class="form-control clean"
																						   maxlength="11"
																						   data-temp-obj="uctUser.mobile"
																						   placeholder="请输入手机"
																						   data-bv-notempty="true"
																						   data-bv-notempty-message="手机不能为空" data-bv-regexp="true" data-bv-regexp-regexp="^(\d{11})$" data-bv-regexp-message="请输入正确的手机号格式">
															</div>
														</td>
														<td class="active" align="right"><label
																class="form-control-static">座机：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.phone"
																						   class="form-control clean"
																						   maxlength="30"
																						   data-temp-obj="uctUser.phone">
															</div>
														</td>
													</tr>
													<tr>
														<td class="active" align="right"><label
																class="form-control-static">邮箱：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.email"
																						   class="form-control clean"
																						   maxlength="30"
																						   data-temp-obj="uctUser.email" data-bv-regexp="true" data-bv-regexp-regexp="^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$" data-bv-regexp-message="请输入正确的邮箱地址">
															</div>
														</td>
														<td class="active" align="right"><label
																class="form-control-static">性别：</label></td>
														<td>
															<div class="form-group">
																<div class="form-control-static"
																	 id="addForm1_uctUser_userSex"
																	 name="uctUser.userSex"
																	 data-temp-obj="uctUser.userSex"
																	 data-dict-code="dictItemList"
																	 data-dict-cate="userSex" data-colmun=""
																	 data-condition="" data-type-tag="radio"
																	 data-def="1">[radio]
																</div>
															</div>
														</td>
													</tr>
													</tbody>
												</table>

											</div>
											<!-- temp="addForm1_content" end -->


											<div class="form-group">
												<div class="col-sm-12">
													<div class="box-footer text-center">
														<button class="btn btn-success pull-left" type="button" onclick="mytools.closeModal('my_modal_add');"> 取消 </button>
														<button class="btn btn-danger pull-right" type="button" onclick="submitForm1('addForm1','');" data-temp-event="addForm1_hidden"> 提 交 </button>
													</div>
												</div>
											</div>

										</form>
									</div>

								</div>
								<!-- tab content e -->
							</div>

						</div>
					</div>
					<!-- /.modal-content -->
				</div>
			</div>

			<div win-title="修改信息窗口" class="modal fade" id="my_modal_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog" style="width:80%;">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								×
							</button>
							<h4 class="modal-title">
								<font color="red">用户信息修改</font> 
							</h4>
						</div>
						<div class="modal-body">
							<div class="nav-tabs-custom">
								<ul class="nav nav-tabs" id="myTab-edit">
								</ul>

								<!-- tab content start -->
								<div class="tab-content">

									<div class="tab-pane active" id="tabEdit_1">
										<form class="form-horizontal editFormBody" role="form" id="editForm1" action="javascript:void(0)">
											<input type="hidden" class="formToken" id="editForm1_formToken" name="formToken" />
											<!-- temp="editForm1_hidden" start -->
											<div id="editForm1_hidden" style="display:none;">
												<input type="hidden" name="pageName" value="user-list"/>
												<input type="hidden" name="formName" value="editForm"/>
												<input type="hidden" name="uctUser.w_userId" data-name="uctUser.userId" class="uctUser_userId clean">
											</div>
											<!-- temp="editForm1_hidden" end -->

											<!-- temp="editForm1_content" start -->
											<div id="editForm1_content">

												<table class="table table-bordered bordercolor">
													<tbody>
													<tr>
														<td class="active" align="right"><label class="form-control-static">登录账号：</label></td>
														<td>
															<div class="form-control-static"><span data-name="uctUser.userEname"></span></div>
														</td>
														<td class="active" align="right"><label class="form-control-static">用户名称：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.userCname" class="form-control clean"
																						   maxlength="30" data-temp-obj="uctUser.userCname"
																						   placeholder="必填项" data-bv-notempty="true"
																						   data-bv-notempty-message="不能为空"
																						   data-name="uctUser.userCname"></div>
														</td>
													</tr>

													<tr>
														<td class="active" align="right"><label class="form-control-static">手机：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.mobile" class="form-control clean"
																						   maxlength="11" data-temp-obj="uctUser.mobile"
																						   placeholder="必填项" data-bv-notempty="true"
																						   data-bv-notempty-message="不能为空"
																						   data-name="uctUser.mobile" data-bv-regexp="true" data-bv-regexp-regexp="^(\d{11})$" data-bv-regexp-message="请输入正确的手机号格式"></div>
														</td>
														<td class="active" align="right"><label class="form-control-static">座机：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.phone" class="form-control clean"
																						   maxlength="30" data-temp-obj="uctUser.phone"
																						   data-name="uctUser.phone"></div>
														</td>
													</tr>
													<tr>
														<td class="active" align="right"><label class="form-control-static">邮箱：</label></td>
														<td>
															<div class="form-group"><input name="uctUser.email" class="form-control clean"
																						   maxlength="30" data-temp-obj="uctUser.email"
																						   data-name="uctUser.email" data-bv-regexp="true" data-bv-regexp-regexp="^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$" data-bv-regexp-message="请输入正确的邮箱地址"></div>
														</td>
														<td class="active" align="right"><label class="form-control-static">性别：</label></td>
														<td>
															<div class="form-group">
																<div class="form-control-static" id="editForm1_uctUser_userSex"
																	 name="uctUser.userSex" data-temp-obj="uctUser.userSex"
																	 data-dict-code="dictItemList" data-dict-cate="userSex" data-colmun=""
																	 data-condition="" data-type-tag="radio" data-def=""
																	 data-name="uctUser.userSex">[radio]
																</div>
															</div>
														</td>
													</tr>
													</tbody>
												</table>

											</div>
											<!-- temp="editForm1_content" end -->

											<div class="form-group">
												<div class="col-sm-12">
													<div class="box-footer text-center">
														<button class="btn btn-success pull-left" type="button" onclick="mytools.closeModal('my_modal_edit');"> 取消 </button>
														<button class="btn btn-danger pull-right" type="button" onclick="submitForm1('editForm1','');" data-temp-event="editForm1_hidden"> 提 交 </button>
													</div>
												</div>
											</div>
										</form>
									</div>

								</div>
								<!-- tab content e -->
							</div>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
			</div>

			<div win-title="修改密码窗口" class="modal fade" id="my_modal_edit_pass" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog" style="width:80%;">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								×
							</button>
							<h4 class="modal-title">
								<font color="red">用户密码修改</font> 
							</h4>
						</div>
						<div class="modal-body">
							<div class="nav-tabs-custom">
								<ul class="nav nav-tabs" id="myTab-edit-pass">
								</ul>

								<!-- tab content start -->
								<div class="tab-content">

									<div class="tab-pane active" id="tabEdit_1_pass">
										<form class="form-horizontal editpassFormBody" role="form" id="editpassForm1" action="javascript:void(0)">
											<input type="hidden" class="formToken" id="editpassForm1_formToken" name="formToken" />
											<!-- temp="editpassForm1_hidden" start -->
											<div id="editpassForm1_hidden" style="display:none;">
												<input type="hidden" name="pageName" value="user-list"/>
												<input type="hidden" name="formName" value="editForm"/>
												<input type="hidden" name="uctUser.w_userId" data-name="uctUser.userId" class="clean">
												<input type="hidden" name="uctUser.userPass" class="clean"/>
											</div>
											<!-- temp="editpassForm1_hidden" end -->

											<!-- temp="editpassForm1_content" start -->
											<div id="editpassForm1_content">

												<table class="table table-bordered bordercolor">
													<tbody>
													<tr>
														<td class="active" align="right"><label class="form-control-static">登录账号：</label></td>
														<td>
															<div class="form-control-static"><span data-name="uctUser.userEname"></span></div>
														</td>
														<td class="active" align="right"><label class="form-control-static">用户名称：</label></td>
														<td>
															<div class="form-control-static"><span data-name="uctUser.userCname"></span></div>
														</td>
													</tr>

													<tr>
														<td class="active" align="right"><label
																class="form-control-static">新的密码：</label></td>
														<td>
															<div class="form-group"><input name="userPass1"
																						   class="form-control clean"
																						   maxlength="30"
																						   placeholder="请输入新的密码"
																						   data-bv-notempty="true"
																						   data-bv-notempty-message="新的密码不能为空"
																						   type="password"></div>
														</td>
														<td class="active" align="right"><label
																class="form-control-static">确认密码：</label></td>
														<td>
															<div class="form-group"><input name="userPass2"
																						   class="form-control clean"
																						   maxlength="30"
																						   placeholder="请输入确认密码"
																						   data-bv-notempty="true"
																						   data-bv-notempty-message="确认密码不能为空"
																						   type="password"></div>
														</td>
													</tr>

													</tbody>
												</table>

											</div>
											<!-- temp="editpassForm1_content" end -->

											<div class="form-group">
												<div class="col-sm-12">
													<div class="box-footer text-center">
														<button class="btn btn-success pull-left" type="button" onclick="mytools.closeModal('my_modal_edit_pass');"> 取消 </button>
														<button class="btn btn-danger pull-right" type="button" onclick="submitForm1('editpassForm1','');" data-temp-event="editpassForm1_hidden"> 提 交 </button>
													</div>
												</div>
											</div>
										</form>
									</div>

								</div>
								<!-- tab content e -->
							</div>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
			</div>
			<div win-title="查看窗口" class="modal fade" id="my_modal_view" tabindex="-2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog" style="width:80%;">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								×
							</button>
							<h4 class="modal-title">
								<font color="red">用户查看详情</font> 
							</h4>
							<form id="viewForm" action="javascript:void(0)">
								<!-- temp="viewForm_hidden" start -->
								<div id="viewForm_hidden" style="display:none;"></div>
								<!-- temp="viewForm_hidden" end -->
							</form>
						</div>
						<div class="modal-body viewForm">

							<div class="nav-tabs-custom">
								<ul class="nav nav-tabs" id="myTab-view">
								</ul>

								<!-- tab content start -->
								<div class="tab-content">

									<div class="tab-pane active" id="tabView_1">
										<form class="form-horizontal" role="form" id="viewForm1" action="javascript:void(0)">

											<!-- temp="viewForm1_content" start -->
											<div id="viewForm1_content" class="row viewForm">


												<table class="table table-bordered bordercolor">
													<tbody>
													<tr>
														<td class="active" align="right"><label class="form-control-static">登录账号：</label></td>
														<td class="w250">
															<div class="form-control-static"><span data-name="uctUser.userEname"></span></div>
														</td>
														<td class="active" align="right"><label class="form-control-static">用户名称：</label></td>
														<td>
															<div class="form-control-static"><span data-name="uctUser.userCname"></span></div>
														</td>
													</tr>
													<tr>
														<td class="active" align="right"><label class="form-control-static">手机：</label></td>
														<td>
															<div class="form-control-static"><span data-name="uctUser.mobile"></span></div>
														</td>
														<td class="active" align="right"><label class="form-control-static">座机：</label></td>
														<td>
															<div class="form-control-static"><span data-name="uctUser.phone"></span></div>
														</td>
													</tr>
													<tr>
														<td class="active" align="right"><label class="form-control-static">邮箱：</label></td>
														<td>
															<div class="form-control-static"><span data-name="uctUser.email"></span></div>
														</td>
														<td class="active" align="right"><label class="form-control-static">性别：</label></td>
														<td>
															<div class="form-control-static"><span id="viewForm1_uctUser_userSex"
																								   data-dict-cate="userSex"
																								   data-dict-code="dictItemList"
																								   data-type-tag="radio" data-name="uctUser.userSex"
																								   data-dict="userSex"></span></div>
														</td>
													</tr>
													</tbody>
												</table>

											</div>
											<!-- temp="viewForm1_content" end -->

										</form>
										<div class="form-group">
											<div class="col-sm-12">
												<div class="box-footer text-center">
													<button class="btn btn-success pull-right" type="button" onclick="mytools.closeModal('my_modal_view');"> 关闭 </button>
												</div>
											</div>
										</div>
									</div>


								</div>
								<!-- tab content e -->
							</div>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
			</div>

			<!-- Part 二、以下是template模板定义的模块区域 -->
			<script type="text/template" id="dataList-template">
				<? for ( var i = 0; i < rows.length; i++) {?>
				<tr>
					<td><?=(pageObj.currentPage-1)*10+(i+1)?></td>
					<!-- temp="dataList_template_content" start -->
					<td style='display:none;'><input type="hidden" name="input_primaryKey" obj-name="uctUser" primary="userId" value="<?=strUtil.doNull(rows[i].uctUser.userId,'')?>"/></td>
					<td><?=strUtil.doNull(rows[i].uctUser.userEname,'')?></td>
					<td><?=strUtil.doNull(rows[i].uctUser.userCname,'')?></td>
					<td><?=strUtil.doNull(rows[i].uctUser.mobile,'')?></td>
					<td><?=getFormatDateByLong(rows[i].uctUser.createTime,'yyyy-MM-dd hh:mm:ss')?></td>
					<td>
						<?if(rows[i].uctUser.userStatus=='1'){?>
						<span class="text-green">启用中</span>
						<?}?>
						<?if(rows[i].uctUser.userStatus=='0'){?>
						<span class="text-red">已停用</span>
						<?}?>
					</td>
					<!-- temp="dataList_template_content" end -->
					<td>
						<button type="button" class="btn btn-success btn-xs" onclick="toLoad(this,'view')"><i class="fa fa-search-plus"></i> 查看</button>  
						<button type="button" class="btn btn-warning btn-xs" onclick="toLoad(this,'edit');"><i class="fa fa-edit"></i> 修改</button>  
						<?if(rows[i].uctUser.userEname!='${loginUser.userEname}'){?>
						<?if(rows[i].uctUser.userStatus=='1'){?>
						<button type="button" class="btn btn-danger btn-xs"  onclick="updataUserStatus('<?=rows[i].uctUser.userId?>',0,'<?=rows[i].uctUser.userEname?>');"><i class="fa fa-stop-circle-o"></i> 停用</button>
						<?}?>
						<?if(rows[i].uctUser.userStatus=='0'){?>
						<button type="button" class="btn btn-primary btn-xs" onclick="updataUserStatus('<?=rows[i].uctUser.userId?>',1,'<?=rows[i].uctUser.userEname?>');"><i class="fa fa-play-circle-o"></i> 启用</button>  
						<button type="button" class="btn btn-danger btn-xs" onclick="toDele(this);"><i class="fa fa-trash-o"></i> 删除 </button>  
						<?}?>
						<?}?>

					</td>
				</tr>
				<?}?>
			</script>

			<!-- Part 三、 以下是js模块区域 -->
			<script>
				var clickMenu = "user-account";
				var myPage,dataListId,searchFormId;
				myPage = 10;//定义列表数据
				dataListId = "dataList";//显示列表数据div的id
				searchFormId = "searchForm";//搜索表单Id
				/**
				 * 初始化数据字典，id传入#id 返回值Map用法：dictListMap["userType"][rows[i].userType]
				 */
				var dictListMap = DictUtil.initDictAndDymic();

				$(function () {
					//1、加载分页列表数据
					getTableData();

					//2、控制是否启用token
					//setToken();

				});

				$(function () {
					//设置数据行选中效果
					$('#'+dataListId+' tbody').on('click','tr', function (e) {
						if ( $(this).hasClass('selected') ) {
						}
						else {
							$('tr.selected').removeClass('selected');
							$(this).addClass('selected');
						}
						//var id = $('tr.selected th').eq(0).html();
					} );
				});
				//注入日历框样式
				var dateObject = $('.datepicker').datepicker( {
					language : 'zh-CN',
					//inline: true,
					todayBtn : "linked",
					format : "yyyy-mm-dd",
					autoclose: true
				}).on('hide',function(e) {
					//bootstrap datepicker与bootstrapValidator同时使用时选择日期后无法正常触发校验的解决方法
					//当日期选择框关闭时，执行刷新校验。
					var fieldName = $(this).attr("name");//获取当前元素name
					var formId = $(this).parents("form").eq(0).attr("id");//获取当前元素所在父层级中的就近的formId
					$("#"+formId).data('bootstrapValidator').updateStatus(fieldName,'NOT_VALIDATED',null).validateField(fieldName);
				});

				//给模态窗口内form表单内的所有支持必填项的元素注入校验
				$(".modal").on('shown.bs.modal', function () {
					$(this).find("form").each(function(){
						var formId = $(this).attr("id");
						if(!strUtil.isNull(formId)){
							formId="#"+formId;
							setValidate(formId);//定义add表单验证属性
							mytools.cleanValidate(formId);//清空上次校验规则提示
						}
					});
				});

				//打开添加modal
				function toAdd(){
					mytools.cleanData(".addFormBody");//清空表单元素上次填写的内容；
					$(".datepicker").val("");
					$("#my_modal_add").modal("show");
				}
				//数据toLoad读取（查看、编辑）数据
				function toLoad(obj,type){
					mytools.cleanData(".editFormBody");
					mytools.cleanData(".editpassFormBody");

					var paramLoadData = {};
					var inputPrimaryObj = $(obj).parent().parent().find("input[name='input_primaryKey']");
					paramLoadData["pageName"]=$("#searchForm").find("input[name='pageName']").val();
					paramLoadData["formName"]=$("#searchForm").find("input[name='formName']").val();
					if(inputPrimaryObj.length>0){
						for(var k=0;k<inputPrimaryObj.length;k++){
							var pkobj=$(inputPrimaryObj[k]);
							paramLoadData[pkobj.attr("obj-name")+".w_"+pkobj.attr("primary")]=pkobj.val();
						}
						$.get(common_info_url, paramLoadData,function(myData){
							console.log(myData);
							//反显加载数据
							if(myData){
								for(var objNameKey in myData){
									console.log(myData[objNameKey]);
									FormUtil.loadView(objNameKey, myData[objNameKey]);
								}
							}
						},"json");
					}

					if("view"==type){
						$("#my_modal_view").modal("show");
					}else if("edit"==type||"editpass"==type){
						var index_submit = layer.confirm('请选择修改内容？', {btn: ['修改信息','修改密码'],closeBtn: 0,offset: '220px'}
								, function(){
									layer.close(index_submit);
									$("#my_modal_edit").modal("show");
								},function () {
									layer.close(index_submit);
									$("#my_modal_edit_pass").modal("show");
								});

					}

				}
				//删除调用
				function toDele(obj){
					if(!$("#delForm_hidden").find("input[name='formName']").val()){
						layer.alert("缺失删除参数！");
						return;
					}
					var index_submit = layer.confirm("您确定要删除信息吗？", {btn: ["Yes","No"],closeBtn: 0,offset: "220px"}
							, function(){
								layer.close(index_submit);
								var paramData = {};
								var inputPrimaryObj = $(obj).parent().parent().find("input[name='input_primaryKey']");
								paramData["pageName"]=$("#delForm_hidden").find("input[name='pageName']").val();
								paramData["formName"]=$("#delForm_hidden").find("input[name='formName']").val();
								if(inputPrimaryObj.length>0){
									for(var k=0;k<inputPrimaryObj.length;k++){
										var pkobj=$(inputPrimaryObj[k]);
										paramData[pkobj.attr("obj-name")+".w_"+pkobj.attr("primary")]=pkobj.val();
									}
									$.ajax({
										type:"post",
										url:common_submit_url,
										data: paramData,dataType:"json",
										success: function(myData){
											var result = myData.flag;
											if(result=="T"){
												refresh();
											}else{
												layer.alert("删除失败！");
											}
										}
									});
								}
							});
				}
				function updataUserStatus(userId, status,userEname) {
					var statusText = "停用";
					if(1==status){
						statusText = "启用";
					}
					var index_submit = layer.confirm("您确定要["+statusText+"]用户["+userEname+"]吗？", {btn: ["Yes","No"],closeBtn: 0,offset: "220px"}
							, function(){
								$.ajax({
									type:"post",
									url:common_submit_url,
									data: {"pageName":"user-list","formName":"editForm","uctUser.w_userId":userId,"uctUser.userStatus":status},dataType:"json",
									success: function(myData){
										var result = myData.flag;
										if(result=="T"){
											layer.msg(statusText+"操作成功！");
											refresh();
										}else{
											layer.msg(statusText+"操作失败！");
										}
									}
								});
							})
				}
				//加载列表数据
				function getTableData(){
					$.ajax({
						type:'get',
						url:common_list_url,
						data:$("#"+searchFormId).serialize()+getCurrentPage(common_list_url+"?"+$("#"+searchFormId).serialize(),myPage),
						dataType:'json',
						success: function(myData){
							console.log(myData);
							var data = baidu.template(dataListId+"-template",eval(myData));
							$("#"+dataListId+"-body").html(data);
							var option= {
								ele:$("#"+dataListId+"-page")[0],
								total:myData.total,
								fn:getTableData,
								url:common_list_url+"?"+$("#"+searchFormId).serialize()
							}
							generatePages(option);
						}
					});
				}


				//提交tab1表单数据
				function submitForm1(formId,tabId){
					//校验规则-表单提交时触发
					var validate = $('#'+formId).data('bootstrapValidator').validate();
					if(!validate.isValid()){ //如果校验不通过就返回
						return;
					}
					if("addForm1"==formId || "editpassForm1"==formId){
						var userPass1 = $('#'+formId).find("input[name='userPass1']").val();
						var userPass2 = $('#'+formId).find("input[name='userPass2']").val();
						if(userPass1!=userPass2){
							layer.alert("两次输入密码不一致！", {closeBtn: 0 });
							$('#'+formId).find("input[name='userPass2']").val("");
							return;
						}
						$('#'+formId).find("input[name='uctUser.userPass']").val(userPass1.md5());
					}

					var index_submit = layer.confirm('您确定要保存信息吗？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
							, function(){
								var result = submitForm(formId,tabId);
								if(result){
									layer.alert("提交成功！", {closeBtn: 0 });
									mytools.closeModal("my_modal_add");
									mytools.closeModal("my_modal_edit");
									mytools.closeModal("my_modal_edit_pass");
									refresh();


									setToken();
									if(!strUtil.isNull(tabId)){
										$('.nav-tabs a[href=\"#'+tabId+'\"]').tab('show'); // Select tab by name
									}
								}
							});

				}
				//提交表单数据
				function submitForm(formId,tabId){
					var result;
					var index_load = layer.load(1, {shade: false});
					$.ajax({
						type:'post',
						url:common_submit_url,
						data:$("#"+formId).serialize(),
						async:false,
						dataType:'json',
						success: function(myData){
							console.log(myData);
							if(myData.flag=="T"){
								result = myData;
							}else{
								setToken();
								layer.alert(myData.msg);
							}
							layer.close(index_load);
						},
						error: function (e) {
							layer.close(index_load);
						}
					});
					return result;
				}

				//刷新
				function refresh(){
					getTableData();
				}
				//设置token
				function setToken(){
					$.ajax({
						type:'get',
						url:'${ctx}/sendPage/token?token=true',
						dataType:'text',
						success: function(myData){
							console.log(myData);
							$('.formToken').val(myData);
						}
					});
				}


				/**** Part 四、以下是自定义新增方法  ****/
//1.定义校验规则-定义
				function setValidate(id){
					$(id).each(function(){
						$(this).bootstrapValidator({
							feedbackIcons: {
								valid: 'glyphicon glyphicon-ok',
								invalid: 'glyphicon glyphicon-remove',
								validating: 'glyphicon glyphicon-refresh'
							},/** 以下需要结合实际业务清空补充个表单元素的验证规则 **/
							fields:{
								/** 可自定义新增验证规则
								 "uctUser.userEname":{
		    		 validators: {
		    			 regexp: {
		    				 regexp: /^[0-9]+$/,
		                      message: '只能是数字'
		                  }
		              }
		    	}
								 **/
							}
						});
					});
				}


			</script>
		</section>
		<!-- Main end -->
	</div>
<!-- foot start -->
<%@include file="/common/ssb/foot.jsp" %>
<!-- foot start -->
</div>
<!-- /.content-wrapper -->
</body>
</html>

